<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        async 异步函数
        ① 修改函数的默认返回值为：new Promise
      */
      // function fn() {
      //   return new Promise((resolove)=>{resolove()})
      // }
      async function fn() {
        throw new Error('...')
      }
      fn()
        .then(() => {
          console.log("then hello");
        })
        .catch((e) => {
          console.log(e.message);
        });
    </script>
  </body>
</html>
